#include "main_interface.h"

#include <QApplication>
#include "create_database_connection.h"
#include "login_dialog.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    //连接数据库
    if (!CreateDatabaseConnection()){
        return 1;
    }

    MainInterface mainInterface;
    LoginDialog loginDialog;

    //主界面--->?
    //主界面--->登录界面
    QObject::connect(&mainInterface, &MainInterface::show2LoginDialog,
                     &loginDialog, static_cast<void (LoginDialog::*)(int , int , int)>(&LoginDialog::initializeLoginDialog));

    //登录界面--->主界面
    QObject::connect(&loginDialog, &LoginDialog::show2MainInterface,
                     &mainInterface, &MainInterface::sendLoginInformation);


    mainInterface.show();
    return a.exec();
}
